home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Development Kits / MPW etc. / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / Components.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-17  |  19.2 KB  |  562 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Components.h
  3.  
  4.      Contains:    Component Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1991-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __COMPONENTS__
  19. #define __COMPONENTS__
  20.  
  21. #ifndef __ERRORS__
  22. #include <Errors.h>
  23. #endif
  24. #ifndef __MACTYPES__
  25. #include <MacTypes.h>
  26. #endif
  27. #ifndef __MIXEDMODE__
  28. #include <MixedMode.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53.  
  54. enum {
  55.     kAppleManufacturer            = FOUR_CHAR_CODE('appl'),        /* Apple supplied components */
  56.     kComponentResourceType        = FOUR_CHAR_CODE('thng'),        /* a components resource type */
  57.     kComponentAliasResourceType    = FOUR_CHAR_CODE('thga')        /* component alias resource type */
  58. };
  59.  
  60.  
  61. enum {
  62.     kAnyComponentType            = 0,
  63.     kAnyComponentSubType        = 0,
  64.     kAnyComponentManufacturer    = 0,
  65.     kAnyComponentFlagsMask        = 0
  66. };
  67.  
  68.  
  69. enum {
  70.     cmpWantsRegisterMessage        = 1L << 31,
  71.     cmpIsComponentAlias            = 1L << 28
  72. };
  73.  
  74.  
  75. enum {
  76.     kComponentOpenSelect        = -1,                            /* ComponentInstance for this open */
  77.     kComponentCloseSelect        = -2,                            /* ComponentInstance for this close */
  78.     kComponentCanDoSelect        = -3,                            /* selector # being queried */
  79.     kComponentVersionSelect        = -4,                            /* no params */
  80.     kComponentRegisterSelect    = -5,                            /* no params */
  81.     kComponentTargetSelect        = -6,                            /* ComponentInstance for top of call chain */
  82.     kComponentUnregisterSelect    = -7,                            /* no params */
  83.     kComponentGetMPWorkFunctionSelect = -8                        /* some params */
  84. };
  85.  
  86. /* Component Resource Extension flags */
  87.  
  88. enum {
  89.     componentDoAutoVersion        = (1 << 0),
  90.     componentWantsUnregister    = (1 << 1),
  91.     componentAutoVersionIncludeFlags = (1 << 2),
  92.     componentHasMultiplePlatforms = (1 << 3),
  93.     componentLoadResident        = (1 << 4)
  94. };
  95.  
  96.  
  97.  
  98. /* Set Default Component flags */
  99.  
  100. enum {
  101.     defaultComponentIdentical    = 0,
  102.     defaultComponentAnyFlags    = 1,
  103.     defaultComponentAnyManufacturer = 2,
  104.     defaultComponentAnySubType    = 4,
  105.     defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
  106.     defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
  107. };
  108.  
  109. /* RegisterComponentResource flags */
  110.  
  111. enum {
  112.     registerComponentGlobal        = 1,
  113.     registerComponentNoDuplicates = 2,
  114.     registerComponentAfterExisting = 4,
  115.     registerComponentAliasesOnly = 8
  116. };
  117.  
  118.  
  119.  
  120. struct ComponentDescription {
  121.     OSType                             componentType;                /* A unique 4-byte code indentifying the command set */
  122.     OSType                             componentSubType;            /* Particular flavor of this instance */
  123.     OSType                             componentManufacturer;        /* Vendor indentification */
  124.     unsigned long                     componentFlags;                /* 8 each for Component,Type,SubType,Manuf/revision */
  125.     unsigned long                     componentFlagsMask;            /* Mask for specifying which flags to consider in search, zero during registration */
  126. };
  127. typedef struct ComponentDescription        ComponentDescription;
  128.  
  129.  
  130. struct ResourceSpec {
  131.     OSType                             resType;                    /* 4-byte code  */
  132.     short                             resID;                        /*              */
  133. };
  134. typedef struct ResourceSpec                ResourceSpec;
  135.  
  136. struct ComponentResource {
  137.     ComponentDescription             cd;                            /* Registration parameters */
  138.     ResourceSpec                     component;                    /* resource where Component code is found */
  139.     ResourceSpec                     componentName;                /* name string resource */
  140.     ResourceSpec                     componentInfo;                /* info string resource */
  141.     ResourceSpec                     componentIcon;                /* icon resource */
  142. };
  143. typedef struct ComponentResource        ComponentResource;
  144. typedef ComponentResource *                ComponentResourcePtr;
  145. typedef ComponentResourcePtr *            ComponentResourceHandle;
  146.  
  147. struct ComponentPlatformInfo {
  148.     long                             componentFlags;                /* flags of Component */
  149.     ResourceSpec                     component;                    /* resource where Component code is found */
  150.     short                             platformType;                /* gestaltSysArchitecture result */
  151. };
  152. typedef struct ComponentPlatformInfo    ComponentPlatformInfo;
  153.  
  154. struct ComponentResourceExtension {
  155.     long                             componentVersion;            /* version of Component */
  156.     long                             componentRegisterFlags;        /* flags for registration */
  157.     short                             componentIconFamily;        /* resource id of Icon Family */
  158. };
  159. typedef struct ComponentResourceExtension ComponentResourceExtension;
  160.  
  161. struct ComponentPlatformInfoArray {
  162.     long                             count;
  163.     ComponentPlatformInfo             platformArray[1];
  164. };
  165. typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
  166.  
  167. struct ExtComponentResource {
  168.     ComponentDescription             cd;                            /* registration parameters */
  169.     ResourceSpec                     component;                    /* resource where Component code is found */
  170.     ResourceSpec                     componentName;                /* name string resource */
  171.     ResourceSpec                     componentInfo;                /* info string resource */
  172.     ResourceSpec                     componentIcon;                /* icon resource */
  173.     long                             componentVersion;            /* version of Component */
  174.     long                             componentRegisterFlags;        /* flags for registration */
  175.     short                             componentIconFamily;        /* resource id of Icon Family */
  176.     long                             count;                        /* elements in platformArray */
  177.     ComponentPlatformInfo             platformArray[1];
  178. };
  179. typedef struct ExtComponentResource        ExtComponentResource;
  180.  
  181. struct ComponentAliasResource {
  182.     ComponentResource                 cr;                            /* Registration parameters */
  183.     ComponentDescription             aliasCD;                    /* component alias description */
  184. };
  185. typedef struct ComponentAliasResource    ComponentAliasResource;
  186. /*  Structure received by Component:        */
  187.  
  188. struct ComponentParameters {
  189.     UInt8                             flags;                        /* call modifiers: sync/async, deferred, immed, etc */
  190.     UInt8                             paramSize;                    /* size in bytes of actual parameters passed to this call */
  191.     short                             what;                        /* routine selector, negative for Component management calls */
  192.     long                             params[1];                    /* actual parameters for the indicated routine */
  193. };
  194. typedef struct ComponentParameters        ComponentParameters;
  195.  
  196. struct ComponentRecord {
  197.     long                             data[1];
  198. };
  199. typedef struct ComponentRecord            ComponentRecord;
  200.  
  201. typedef ComponentRecord *                Component;
  202.  
  203. struct ComponentInstanceRecord {
  204.     long                             data[1];
  205. };
  206. typedef struct ComponentInstanceRecord    ComponentInstanceRecord;
  207.  
  208. typedef ComponentInstanceRecord *        ComponentInstance;
  209.  
  210. struct RegisteredComponentRecord {
  211.     long                             data[1];
  212. };
  213. typedef struct RegisteredComponentRecord RegisteredComponentRecord;
  214.  
  215. struct RegisteredComponentInstanceRecord {
  216.     long                             data[1];
  217. };
  218. typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
  219. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
  220.  
  221. typedef long                             ComponentResult;
  222.  
  223. enum {
  224.     platform68k                    = 1,                            /* platform type (response from gestaltSysArchitecture) */
  225.     platformPowerPC                = 2,
  226.     platformInterpreted            = 3,
  227.     platformWin32                = 4
  228. };
  229.  
  230.  
  231. enum {
  232.     mpWorkFlagDoWork            = (1 << 0),
  233.     mpWorkFlagDoCompletion        = (1 << 1),
  234.     mpWorkFlagCopyWorkBlock        = (1 << 2),
  235.     mpWorkFlagDontBlock            = (1 << 3),
  236.     mpWorkFlagGetProcessorCount    = (1 << 4),
  237.     mpWorkFlagGetIsRunning        = (1 << 6)
  238. };
  239.  
  240.  
  241. struct ComponentMPWorkFunctionHeaderRecord {
  242.     UInt32                             headerSize;
  243.     UInt32                             recordSize;
  244.     UInt32                             workFlags;
  245.     UInt16                             processorCount;
  246.     UInt8                             unused;
  247.     UInt8                             isRunning;
  248. };
  249. typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
  250. typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
  251. typedef CALLBACK_API( ComponentResult , ComponentMPWorkFunctionProcPtr )(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
  252. typedef CALLBACK_API( ComponentResult , ComponentRoutineProcPtr )(ComponentParameters *cp, Handle componentStorage);
  253. typedef STACK_UPP_TYPE(ComponentMPWorkFunctionProcPtr)             ComponentMPWorkFunctionUPP;
  254. typedef STACK_UPP_TYPE(ComponentRoutineProcPtr)                 ComponentRoutineUPP;
  255. /*
  256.     The parameter list for each ComponentFunction is unique. It is
  257.     therefore up to users to create the appropriate procInfo for their
  258.     own ComponentFunctions where necessary.
  259. */
  260.  
  261. typedef UniversalProcPtr                 ComponentFunctionUPP;
  262. #if TARGET_RT_MAC_CFM
  263. /* 
  264.     CallComponentUPP is a global variable exported from InterfaceLib.
  265.     It is the ProcPtr passed to CallUniversalProc to manually call a component function.
  266. */
  267. extern UniversalProcPtr CallComponentUPP;
  268. #endif
  269.  
  270. #define ComponentCallNow( callNumber, paramSize ) \
  271.     FIVEWORDINLINE( 0x2F3C,paramSize,callNumber,0x7000,0xA82A )
  272.  
  273. /********************************************************
  274. *                                                        *
  275. *                  APPLICATION LEVEL CALLS                    *
  276. *                                                        *
  277. ********************************************************/
  278. /********************************************************
  279. * Component Database Add, Delete, and Query Routines
  280. ********************************************************/
  281. EXTERN_API( Component )
  282. RegisterComponent                (ComponentDescription *    cd,
  283.                                  ComponentRoutineUPP     componentEntryPoint,
  284.                                  short                     global,
  285.                                  Handle                 componentName,
  286.                                  Handle                 componentInfo,
  287.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7001, 0xA82A);
  288.  
  289. EXTERN_API( Component )
  290. RegisterComponentResource        (ComponentResourceHandle  cr,
  291.                                  short                     global)                                TWOWORDINLINE(0x7012, 0xA82A);
  292.  
  293. EXTERN_API( OSErr )
  294. UnregisterComponent                (Component                 aComponent)                            TWOWORDINLINE(0x7002, 0xA82A);
  295.  
  296. EXTERN_API( Component )
  297. FindNextComponent                (Component                 aComponent,
  298.                                  ComponentDescription *    looking)                            TWOWORDINLINE(0x7004, 0xA82A);
  299.  
  300. EXTERN_API( long )
  301. CountComponents                    (ComponentDescription *    looking)                            TWOWORDINLINE(0x7003, 0xA82A);
  302.  
  303. EXTERN_API( OSErr )
  304. GetComponentInfo                (Component                 aComponent,
  305.                                  ComponentDescription *    cd,
  306.                                  Handle                 componentName,
  307.                                  Handle                 componentInfo,
  308.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7005, 0xA82A);
  309.  
  310. EXTERN_API( long )
  311. GetComponentListModSeed            (void)                                                        TWOWORDINLINE(0x7006, 0xA82A);
  312.  
  313. EXTERN_API( long )
  314. GetComponentTypeModSeed            (OSType                 componentType)                        TWOWORDINLINE(0x702C, 0xA82A);
  315.  
  316. /********************************************************
  317. * Component Instance Allocation and dispatch routines
  318. ********************************************************/
  319. EXTERN_API( OSErr )
  320. OpenAComponent                    (Component                 aComponent,
  321.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702D, 0xA82A);
  322.  
  323. EXTERN_API( ComponentInstance )
  324. OpenComponent                    (Component                 aComponent)                            TWOWORDINLINE(0x7007, 0xA82A);
  325.  
  326. EXTERN_API( OSErr )
  327. CloseComponent                    (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x7008, 0xA82A);
  328.  
  329. EXTERN_API( OSErr )
  330. GetComponentInstanceError        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700A, 0xA82A);
  331.  
  332. /********************************************************
  333. *                                                        *
  334. *                      CALLS MADE BY COMPONENTS              *
  335. *                                                        *
  336. ********************************************************/
  337. /********************************************************
  338. * Component Management routines
  339. ********************************************************/
  340. EXTERN_API( void )
  341. SetComponentInstanceError        (ComponentInstance         aComponentInstance,
  342.                                  OSErr                     theError)                            TWOWORDINLINE(0x700B, 0xA82A);
  343.  
  344. EXTERN_API( long )
  345. GetComponentRefcon                (Component                 aComponent)                            TWOWORDINLINE(0x7010, 0xA82A);
  346.  
  347. EXTERN_API( void )
  348. SetComponentRefcon                (Component                 aComponent,
  349.                                  long                     theRefcon)                            TWOWORDINLINE(0x7011, 0xA82A);
  350.  
  351. EXTERN_API( short )
  352. OpenComponentResFile            (Component                 aComponent)                            TWOWORDINLINE(0x7015, 0xA82A);
  353.  
  354. EXTERN_API( OSErr )
  355. OpenAComponentResFile            (Component                 aComponent,
  356.                                  short *                resRef)                                TWOWORDINLINE(0x702F, 0xA82A);
  357.  
  358. EXTERN_API( OSErr )
  359. CloseComponentResFile            (short                     refnum)                                TWOWORDINLINE(0x7018, 0xA82A);
  360.  
  361. EXTERN_API( OSErr )
  362. GetComponentResource            (Component                 aComponent,
  363.                                  OSType                 resType,
  364.                                  short                     resID,
  365.                                  Handle *                theResource)                        TWOWORDINLINE(0x7035, 0xA82A);
  366.  
  367. EXTERN_API( OSErr )
  368. GetComponentIndString            (Component                 aComponent,
  369.                                  Str255                 theString,
  370.                                  short                     strListID,
  371.                                  short                     index)                                TWOWORDINLINE(0x7036, 0xA82A);
  372.  
  373. EXTERN_API( Component )
  374. ResolveComponentAlias            (Component                 aComponent)                            TWOWORDINLINE(0x7020, 0xA82A);
  375.  
  376. /********************************************************
  377. * Component Instance Management routines
  378. ********************************************************/
  379. EXTERN_API( Handle )
  380. GetComponentInstanceStorage        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700C, 0xA82A);
  381.  
  382. EXTERN_API( void )
  383. SetComponentInstanceStorage        (ComponentInstance         aComponentInstance,
  384.                                  Handle                 theStorage)                            TWOWORDINLINE(0x700D, 0xA82A);
  385.  
  386. EXTERN_API( long )
  387. GetComponentInstanceA5            (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700E, 0xA82A);
  388.  
  389. EXTERN_API( void )
  390. SetComponentInstanceA5            (ComponentInstance         aComponentInstance,
  391.                                  long                     theA5)                                TWOWORDINLINE(0x700F, 0xA82A);
  392.  
  393. EXTERN_API( long )
  394. CountComponentInstances            (Component                 aComponent)                            TWOWORDINLINE(0x7013, 0xA82A);
  395.  
  396. /* useful helper routines for convenient method dispatching */
  397. EXTERN_API( long )
  398. CallComponentFunction            (ComponentParameters *    params,
  399.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  400.  
  401. EXTERN_API( long )
  402. CallComponentFunctionWithStorage (Handle                 storage,
  403.                                  ComponentParameters *    params,
  404.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  405.  
  406. #if TARGET_CPU_PPC && TARGET_OS_MAC
  407. EXTERN_API( long )
  408. CallComponentFunctionWithStorageProcInfo (Handle         storage,
  409.                                  ComponentParameters *    params,
  410.                                  ProcPtr                 func,
  411.                                  long                     funcProcInfo);
  412.  
  413. #else
  414. #define CallComponentFunctionWithStorageProcInfo(storage, params, func, funcProcInfo ) CallComponentFunctionWithStorage(storage, params, func)
  415.  
  416. #endif  /* TARGET_CPU_PPC && TARGET_OS_MAC */
  417.  
  418. EXTERN_API( long )
  419. DelegateComponentCall            (ComponentParameters *    originalParams,
  420.                                  ComponentInstance         ci)                                    TWOWORDINLINE(0x7024, 0xA82A);
  421.  
  422. EXTERN_API( OSErr )
  423. SetDefaultComponent                (Component                 aComponent,
  424.                                  short                     flags)                                TWOWORDINLINE(0x701E, 0xA82A);
  425.  
  426. EXTERN_API( ComponentInstance )
  427. OpenDefaultComponent            (OSType                 componentType,
  428.                                  OSType                 componentSubType)                    TWOWORDINLINE(0x7021, 0xA82A);
  429.  
  430. EXTERN_API( OSErr )
  431. OpenADefaultComponent            (OSType                 componentType,
  432.                                  OSType                 componentSubType,
  433.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702E, 0xA82A);
  434.  
  435. EXTERN_API( Component )
  436. CaptureComponent                (Component                 capturedComponent,
  437.                                  Component                 capturingComponent)                    TWOWORDINLINE(0x701C, 0xA82A);
  438.  
  439. EXTERN_API( OSErr )
  440. UncaptureComponent                (Component                 aComponent)                            TWOWORDINLINE(0x701D, 0xA82A);
  441.  
  442. EXTERN_API( long )
  443. RegisterComponentResourceFile    (short                     resRefNum,
  444.                                  short                     global)                                TWOWORDINLINE(0x7014, 0xA82A);
  445.  
  446. EXTERN_API( OSErr )
  447. GetComponentIconSuite            (Component                 aComponent,
  448.                                  Handle *                iconSuite)                            TWOWORDINLINE(0x7029, 0xA82A);
  449.  
  450.  
  451. /********************************************************
  452. *                                                        *
  453. *              Direct calls to the Components                *
  454. *                                                        *
  455. ********************************************************/
  456. /* Old style names*/
  457.  
  458. EXTERN_API( long )
  459. ComponentFunctionImplemented    (ComponentInstance         ci,
  460.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  461.  
  462. EXTERN_API( long )
  463. GetComponentVersion                (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  464.  
  465. EXTERN_API( long )
  466. ComponentSetTarget                (ComponentInstance         ci,
  467.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  468.  
  469. /* New style names*/
  470.  
  471. EXTERN_API( ComponentResult )
  472. CallComponentOpen                (ComponentInstance         ci,
  473.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFF, 0x7000, 0xA82A);
  474.  
  475. EXTERN_API( ComponentResult )
  476. CallComponentClose                (ComponentInstance         ci,
  477.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFE, 0x7000, 0xA82A);
  478.  
  479. EXTERN_API( ComponentResult )
  480. CallComponentCanDo                (ComponentInstance         ci,
  481.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  482.  
  483. EXTERN_API( ComponentResult )
  484. CallComponentVersion            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  485.  
  486. EXTERN_API( ComponentResult )
  487. CallComponentRegister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFB, 0x7000, 0xA82A);
  488.  
  489. EXTERN_API( ComponentResult )
  490. CallComponentTarget                (ComponentInstance         ci,
  491.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  492.  
  493. EXTERN_API( ComponentResult )
  494. CallComponentUnregister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFF9, 0x7000, 0xA82A);
  495.  
  496. EXTERN_API( ComponentResult )
  497. CallComponentGetMPWorkFunction    (ComponentInstance         ci,
  498.                                  ComponentMPWorkFunctionUPP * workFunction,
  499.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0xFFF8, 0x7000, 0xA82A);
  500.  
  501.  
  502. #if !TARGET_OS_MAC
  503. /* 
  504.         CallComponent is used by ComponentGlue routines to manually call a component function.
  505.      */
  506. EXTERN_API( ComponentResult )
  507. CallComponent                    (ComponentInstance         ci,
  508.                                  ComponentParameters *    cp);
  509.  
  510. #endif  /*  !TARGET_OS_MAC */
  511.  
  512. /* UPP call backs */
  513. enum { uppComponentMPWorkFunctionProcInfo = 0x000003F0 };         /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  514. enum { uppComponentRoutineProcInfo = 0x000003F0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  515. #define NewComponentMPWorkFunctionProc(userRoutine)             (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture())
  516. #define NewComponentRoutineProc(userRoutine)                     (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture())
  517. #define CallComponentMPWorkFunctionProc(userRoutine, globalRefCon, header)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentMPWorkFunctionProcInfo, (globalRefCon), (header))
  518. #define CallComponentRoutineProc(userRoutine, cp, componentStorage)  CALL_TWO_PARAMETER_UPP((userRoutine), uppComponentRoutineProcInfo, (cp), (componentStorage))
  519. /* ProcInfos */
  520.  
  521. /* MixedMode ProcInfo constants for component calls */
  522. enum {
  523.     uppComponentFunctionImplementedProcInfo            = 0x000002F0,
  524.     uppGetComponentVersionProcInfo                    = 0x000000F0,
  525.     uppComponentSetTargetProcInfo                    = 0x000003F0,
  526.     uppCallComponentOpenProcInfo                    = 0x000003F0,
  527.     uppCallComponentCloseProcInfo                    = 0x000003F0,
  528.     uppCallComponentCanDoProcInfo                    = 0x000002F0,
  529.     uppCallComponentVersionProcInfo                    = 0x000000F0,
  530.     uppCallComponentRegisterProcInfo                = 0x000000F0,
  531.     uppCallComponentTargetProcInfo                    = 0x000003F0,
  532.     uppCallComponentUnregisterProcInfo                = 0x000000F0,
  533.     uppCallComponentGetMPWorkFunctionProcInfo        = 0x00000FF0
  534. };
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542. #if PRAGMA_STRUCT_ALIGN
  543.     #pragma options align=reset
  544. #elif PRAGMA_STRUCT_PACKPUSH
  545.     #pragma pack(pop)
  546. #elif PRAGMA_STRUCT_PACK
  547.     #pragma pack()
  548. #endif
  549.  
  550. #ifdef PRAGMA_IMPORT_OFF
  551. #pragma import off
  552. #elif PRAGMA_IMPORT
  553. #pragma import reset
  554. #endif
  555.  
  556. #ifdef __cplusplus
  557. }
  558. #endif
  559.  
  560. #endif /* __COMPONENTS__ */
  561.  
  562.